const {ref, watch} = Vue;
const template = `<div>
                    <span>姓名: {{name}}</span>
                    <span>年龄: {{age}}</span>
                    <span>姓别: {{sex}}</span>
                  </div>`;
const props = {
    name: String,
    age: Number,
    sex: String
}

const setup = function () {
    watch(() => props.name, (val) => {
        console.log('name变化了', val);
    }, {immediate: true})
    const count = ref('100');
    function inc() {
        count.value++;
    }
    return {
        count,
        inc,

    }
}

export default {
    props,
    template,
    setup
}
